import { Context } from 'koa'

export default async (ctx: Context, next: () => Promise<void>) => {
  if (ctx.path === '/admin/tableConfig/getCode') {
    ctx.set('Access-Control-Allow-Origin', '*')
    ctx.set('Access-Control-Allow-Methods', 'GET, POST')
    ctx.set('Access-Control-Allow-Headers', 'Content-Type')
  }
  await next()
}
